package defi5;

import java.util.ArrayList;
import java.util.List;

public class Image {

	public List<Point> image;
	public int w,h;

	public Image(int w, int h) {
		image = new ArrayList<Point>();
		int num = 0;
		this.w = w;
		this.h = h;
		//Pour chaque Ligne
		for(int l = 0; l < h  ; l++) {
			//Pour chaque colonne
			for(int c = 0; c<h ; c++) {
				Point p = new Point(c, l);
				p.numeroPoint = num;
				image.add(p);
				num++;
			}
		}

		System.out.println("Taille de l'image : " + image.size());
	}
	
	public int getIndicePoint(Point p) {
    	return (p.x) + (p.y)*w;
    }

}
